package com.jiawa.wiki.config;


import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.ConfigurableEnvironment;

@SpringBootApplication
@ComponentScan(basePackages = "com.jiawa")
@MapperScan(basePackages = "com.jiawa.wiki.mapper")
public class WiKiApplication {
    public static void main(String [] args){
        //以日志的形式打印配置文件信息
        Logger logger= LoggerFactory.getLogger(WiKiApplication.class);
        SpringApplication springApplication=new SpringApplication(WiKiApplication.class);

        ConfigurableEnvironment environment= springApplication.run(args).getEnvironment();

        logger.info("项目启动成功");
        logger.info(environment.getProperty("server.port"));
    }
}
